package com.sora.sora.security.authorise.model.param;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Set;

@Data
public class RoleParam {

    @NotNull(message = "角色id不能为空", groups = UpdateRole.class)
    private int id;

    @NotBlank(message = "角色名称不能为空", groups = CreateRole.class)
    @Length(min = 1, max = 50, message = "角色名称请设置在1~50个字符之内!")
    private String name;

    @NotBlank(message = "创建者不能为空")
    private String creator;

    private Set<Integer> resourcesId;

    public interface CreateRole {}

    public interface UpdateRole {}
}
